1. Field of the Invention
This invention relates to microprocessors and, more particularly, hardware prefetching.
2. Description of the Related Art
Modern microprocessors attempt to detect patterns in memory accesses and to prefetch memory locations into the processor caches in an effort to reduce latencies associated with memory accesses. However, some access patterns may cause the prefetch hardware to prefetch memory blocks that will not be used. Since the caches are limited in size, the unused blocks may cause useful blocks to be flushed from the caches.
One example, of a pattern that does not lend itself to efficient hardware prefetching is a pattern created by “walking” through the elements of a linked list, and reading some of the data in the objects in the linked list. If reading the data in each object reads in enough cache lines to trigger the hardware prefetcher, it is unlikely that the next sequential data fetched is likely to be accessed soon. Accordingly, in this case, valuable cache space may be wasted, and the useful data may be evicted.